package com.zmj.tl.database.taos.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author hd
 * @desc 预处理采集点约束
 * @since 2024/1/29 10:41
 */
@Data
@ToString
@NoArgsConstructor
public class TreatSchema implements Serializable {
    private static final long serialVersionUID = 1145846920821835381L;
    /**
     * 库名
     */
    private String dbName = "iiot";
    /**
     * 超级表名
     */
    private String tbName = "treat";
    /**
     * 子表名
     */
    private String stbName = "d1001";
    /**
     * 超级表数据列
     */
    private String metricSchema = "ts timestamp, value binary(10)";
    /**
     * 超级表Tags
     */
    private String tagSchema = "device_no binary(32), device_name binary(32), name binary(32), attribute binary(32), tenant_id binary(32)";
    /**
     * 数据属性
     */
    private String metricColumn = "ts, value";
    /**
     * 标签属性
     */
    private String tagColumn = "ts, device_no, device_name, attribute, name, tenant_id";
    /**
     * 单个写入数据列
     */
    private String oneRow = "#{td.ts}, #{td.value}";
    /**
     * 单个写入标签列
     */
    private String oneTag = "#{td.device_no}, #{td.device_name}, #{td.attribute}, #{td.name}, #{td.tenant_id}";
    /**
     * 批量写入属性
     */
    private String batchRow = "#{item.ts}, #{item.value}";
}
